package com.briup.ch07.object;
enum Gender2{
    MALE(){
        @Override
        public String getDesc() {
            return "男生";
        }
    },FEMALE(){
        @Override
        public String getDesc() {
            return "女生";
        }
    };
    public abstract String getDesc();
    public int getPostion()
    {
        return this.ordinal();
    }
}
public class Test_Enum2 {
    public static void main(String[] args) {
        Gender2 g1=Gender2.MALE;
        Gender2 g2=Gender2.FEMALE;
        System.out.println(g1.getDesc());
        System.out.println(g2.getDesc());
        System.out.println(g1.getPostion());
    }
}
